<?php
	session_start();

	include('functions/soap.php');
	include('head.php');

	if(!empty($_POST['username']) && !empty($_POST['password']))
	{
		$loginresult = login($_POST['username'], $_POST['password']);
		if($loginresult != 'Invalid Login')
		{
			$info='<div class="ok"> U bent nu ingelogd als: ';
			$info.= $_SESSION['name'].' (Rol: '.$_SESSION['Rol'].')</div>';
		}
		else
		{
			$info= '<div class="error">'.$loginresult.'</div>';
		}
	}
?>

<body>

    <div class="wrapper">

    	<div class="header"><img src="img/logo.gif" /></div>
        <?php include('logininfo.php') ?>
        <div class="menu"><?php include('menu.php'); ?></div>
		<div class="sidebar">

			<?php include('copyrightBox.php') ?>

		</div>

    	<div class="content">
        	<h3 class="header">Welkom</h3>
	    <?php
	    	if(!isset($_SESSION['session']))
			{
	    		include('subpages/loginform.php');
			}
			else
			{
				echo('<a href="" onClick="window.open (\'subpages/wijzig_wachtwoord.php\',
\'mywindow\',\'menubar=0,resizable=0,width=500,height=220\');">Wachtwoord wijzigen</a>');
			}
				
			echo($info);
		?>
        
        <!-- Debug purposes 
        <pre>
        <?php
			//echo('Rol: '.$_SESSION['Rol']);
			//print_r(getModuleFields('st_Stage'));
			//print_r(getAModules());
		?>
        </pre>
        -->
		</div>
    </div>
</body>
</html>
